<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class TypeProf::RubySignatureExporter - typeprof: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-build_class_hierarchy">#build_class_hierarchy</a>
    <li ><a href="#method-i-conv_class">#conv_class</a>
    <li ><a href="#method-i-conv_class_lsp">#conv_class_lsp</a>
    <li ><a href="#method-i-show">#show</a>
    <li ><a href="#method-i-show_class_data">#show_class_data</a>
    <li ><a href="#method-i-show_class_hierarchy">#show_class_hierarchy</a>
    <li ><a href="#method-i-show_const">#show_const</a>
    <li ><a href="#method-i-show_lsp">#show_lsp</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-TypeProf::RubySignatureExporter">
    <h1 id="class-TypeProf::RubySignatureExporter" class="class">
      class TypeProf::RubySignatureExporter
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="ClassData">ClassData
          <dd>
        </dl>
        </section>



                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">( scratch, class_defs, iseq_method_to_ctxs )</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/export.rb, line 89</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(
  <span class="ruby-identifier">scratch</span>,
  <span class="ruby-identifier">class_defs</span>, <span class="ruby-identifier">iseq_method_to_ctxs</span>
)
  <span class="ruby-ivar">@scratch</span> = <span class="ruby-identifier">scratch</span>
  <span class="ruby-ivar">@class_defs</span> = <span class="ruby-identifier">class_defs</span>
  <span class="ruby-ivar">@iseq_method_to_ctxs</span> = <span class="ruby-identifier">iseq_method_to_ctxs</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-build_class_hierarchy" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">build_class_hierarchy</span><span
                                class="method-args">(namespace, hierarchy)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="build_class_hierarchy-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/export.rb, line 488</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">build_class_hierarchy</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">hierarchy</span>)
  <span class="ruby-identifier">hierarchy</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">h</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">class_def</span> = <span class="ruby-identifier">h</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:class_def</span>)
    <span class="ruby-identifier">class_data</span> = <span class="ruby-identifier">conv_class</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">class_def</span>, <span class="ruby-identifier">build_class_hierarchy</span>(<span class="ruby-identifier">namespace</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">name</span>], <span class="ruby-identifier">h</span>))
    <span class="ruby-identifier">class_data</span>
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">compact</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_class" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_class</span><span
                                class="method-args">(namespace, class_def, inner_classes)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="conv_class-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/export.rb, line 98</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_class</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">class_def</span>, <span class="ruby-identifier">inner_classes</span>)
  <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">namespace</span> = <span class="ruby-identifier">namespace</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:__root__</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass</span>
    <span class="ruby-identifier">omit</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Builtin</span>[<span class="ruby-value">:obj</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Builtin</span>[<span class="ruby-value">:obj</span>]
    <span class="ruby-identifier">superclass</span> = <span class="ruby-identifier">omit</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">get_class_name</span>(<span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass</span>)
    <span class="ruby-identifier">type_args</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass_type_args</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">type_args</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">type_args</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">superclass</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot;[#{ type_args.map {|ty| ty.screen_name(@scratch) }.join(&quot;, &quot;) }]&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">namespace</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">name</span>

  <span class="ruby-identifier">consts</span> = {}
  <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">consts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, (<span class="ruby-identifier">ty</span>, <span class="ruby-identifier">loc</span>)<span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">loc</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>)
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">loc</span>[<span class="ruby-value">0</span>]) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>
    <span class="ruby-identifier">consts</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">modules</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">modules</span>.<span class="ruby-identifier">to_h</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">kind</span>, <span class="ruby-identifier">mods</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">mods</span> = <span class="ruby-identifier">mods</span>.<span class="ruby-identifier">to_h</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mods</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">mods</span> = <span class="ruby-identifier">mods</span>.<span class="ruby-identifier">filter_map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mod_def</span>, <span class="ruby-identifier">_type_args</span>, <span class="ruby-identifier">absolute_paths</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">absolute_paths</span>.<span class="ruby-identifier">all?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">path</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span> }
        <span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Instance</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">mod_def</span>.<span class="ruby-identifier">klass_obj</span>).<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>)
      <span class="ruby-keyword">end</span>
      [<span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mods</span>]
    <span class="ruby-keyword">end</span>
    [<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">mods</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">visibilities</span> = {}
  <span class="ruby-identifier">source_locations</span> = {}
  <span class="ruby-identifier">methods</span> = {}
  <span class="ruby-identifier">ivars</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">ivars</span>.<span class="ruby-identifier">dump</span>
  <span class="ruby-identifier">cvars</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">cvars</span>.<span class="ruby-identifier">dump</span>

  <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span>(<span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mid</span>), <span class="ruby-identifier">mdefs</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">mdefs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mdef</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">mdef</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">ISeqMethodDef</span>
        <span class="ruby-identifier">ctxs</span> = <span class="ruby-ivar">@iseq_method_to_ctxs</span>[<span class="ruby-identifier">mdef</span>]
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">ctxs</span>

        <span class="ruby-identifier">ctx</span> = <span class="ruby-identifier">ctxs</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">ctx</span><span class="ruby-operator">|</span> <span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">mid</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mid</span> } <span class="ruby-operator">||</span> <span class="ruby-identifier">ctxs</span>.<span class="ruby-identifier">first</span>

        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">absolute_path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>

        <span class="ruby-identifier">method_name</span> = <span class="ruby-identifier">mid</span>
        <span class="ruby-identifier">method_name</span> = <span class="ruby-node">&quot;self.#{ method_name }&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton</span>

        <span class="ruby-identifier">key</span> = [<span class="ruby-value">:iseq</span>, <span class="ruby-identifier">method_name</span>]
        <span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">pub_meth</span>
        <span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">source_location</span>(<span class="ruby-value">0</span>)
        (<span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">show_method_signature</span>(<span class="ruby-identifier">ctx</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-constant">AliasMethodDef</span>
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">def_ep</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">def_ep</span>.<span class="ruby-identifier">source_location</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>
        <span class="ruby-identifier">alias_name</span>, <span class="ruby-identifier">orig_name</span> = <span class="ruby-identifier">mid</span>, <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">orig_mid</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton</span>
          <span class="ruby-identifier">alias_name</span> = <span class="ruby-node">&quot;self.#{ alias_name }&quot;</span>
          <span class="ruby-identifier">orig_name</span> = <span class="ruby-node">&quot;self.#{ orig_name }&quot;</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">key</span> = [<span class="ruby-value">:alias</span>, <span class="ruby-identifier">alias_name</span>]
        <span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">pub_meth</span>
        <span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">def_ep</span>&amp;.<span class="ruby-identifier">source_location</span>
        <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">orig_name</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">ExecutedAttrMethodDef</span>
        <span class="ruby-identifier">absolute_path</span> = <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">def_ep</span>.<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">absolute_path</span>
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">absolute_path</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">absolute_path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>
        <span class="ruby-identifier">mid</span> = <span class="ruby-identifier">mid</span>.<span class="ruby-identifier">to_s</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>].<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mid</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-string">&quot;=&quot;</span>)
        <span class="ruby-identifier">method_name</span> = <span class="ruby-identifier">mid</span>
        <span class="ruby-identifier">method_name</span> = <span class="ruby-node">&quot;self.#{ mid }&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton</span>
        <span class="ruby-identifier">method_name</span> = [<span class="ruby-identifier">method_name</span>, <span class="ruby-value">:&quot;@#{ mid }&quot;</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">ivar</span>]
        <span class="ruby-identifier">key</span> = [<span class="ruby-value">:attr</span>, <span class="ruby-identifier">method_name</span>]
        <span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">pub_meth</span>
        <span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">def_ep</span>.<span class="ruby-identifier">source_location</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>]
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>][<span class="ruby-value">0</span>] <span class="ruby-operator">!=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">kind</span>
            <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>][<span class="ruby-value">0</span>] = <span class="ruby-value">:accessor</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">ivars</span>[[<span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">ivar</span>]]
          <span class="ruby-identifier">ty</span> = <span class="ruby-identifier">entry</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Type</span>.<span class="ruby-identifier">any</span>
          <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>] = [<span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>), <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">include_untyped?</span>(<span class="ruby-ivar">@scratch</span>)]
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">TypedMethodDef</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">rbs_source</span>
          <span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">sigs</span> = <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">rbs_source</span>
          <span class="ruby-identifier">key</span> = [<span class="ruby-value">:rbs</span>, <span class="ruby-identifier">method_name</span>]
          <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">sigs</span>
          <span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">pub_meth</span>
          <span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">iseq</span>&amp;.<span class="ruby-identifier">source_location</span>(<span class="ruby-value">0</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">TypedAttrMethodDef</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">rbs_source</span>
          <span class="ruby-identifier">mid</span> = <span class="ruby-identifier">mid</span>.<span class="ruby-identifier">to_s</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>].<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mid</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-string">&quot;=&quot;</span>)
          <span class="ruby-identifier">method_name</span> = <span class="ruby-identifier">mid</span>
          <span class="ruby-identifier">method_name</span> = [<span class="ruby-identifier">method_name</span>, <span class="ruby-value">:&quot;@#{ mid }&quot;</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">ivar</span>]
          <span class="ruby-identifier">key</span> = [<span class="ruby-value">:rbs_attr</span>, <span class="ruby-identifier">method_name</span>]
          <span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">pub_meth</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>]
            <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>][<span class="ruby-value">0</span>] <span class="ruby-operator">!=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">kind</span>
              <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>][<span class="ruby-value">0</span>] = <span class="ruby-value">:accessor</span>
            <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">ivars</span>[[<span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">ivar</span>]]
            <span class="ruby-identifier">ty</span> = <span class="ruby-identifier">entry</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Type</span>.<span class="ruby-identifier">any</span>
            <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>] = [<span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>), <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">include_untyped?</span>(<span class="ruby-ivar">@scratch</span>)]
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">superclass_ivars</span> = {}
  <span class="ruby-keyword">while</span> (<span class="ruby-identifier">superclass_def</span> = (<span class="ruby-identifier">superclass_def</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">class_def</span>).<span class="ruby-identifier">superclass</span>)
    <span class="ruby-identifier">superclass_ivars</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">superclass_def</span>.<span class="ruby-identifier">ivars</span>.<span class="ruby-identifier">dump</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">ivars</span> = <span class="ruby-identifier">ivars</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span>(<span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">var</span>), <span class="ruby-identifier">entry</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">absolute_paths</span>.<span class="ruby-identifier">all?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span> }
    <span class="ruby-identifier">ty</span> = <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">var</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;@&quot;</span>)

    <span class="ruby-keyword">if</span> (<span class="ruby-identifier">_</span>, <span class="ruby-identifier">existing</span> = <span class="ruby-identifier">superclass_ivars</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span>((<span class="ruby-identifier">s</span>, <span class="ruby-identifier">v</span>), <span class="ruby-identifier">_</span>)<span class="ruby-operator">|</span> <span class="ruby-identifier">s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">singleton</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">var</span> })
      <span class="ruby-identifier">existing_types</span> = <span class="ruby-identifier">existing</span>.<span class="ruby-identifier">type</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Union</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">existing</span>.<span class="ruby-identifier">type</span>.<span class="ruby-identifier">types</span> <span class="ruby-operator">:</span> [<span class="ruby-identifier">existing</span>.<span class="ruby-identifier">type</span>]
      <span class="ruby-identifier">entry_types</span> = <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Union</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span>.<span class="ruby-identifier">types</span> <span class="ruby-operator">:</span> [<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span>]
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry_types</span>.<span class="ruby-identifier">all?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">existing_types</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">t</span>) }
        <span class="ruby-comment"># This type is a subset of the parent type</span>
        <span class="ruby-keyword">next</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">var</span> = <span class="ruby-node">&quot;self.#{ var }&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>[[<span class="ruby-value">:attr</span>, [<span class="ruby-identifier">singleton</span> <span class="ruby-operator">?</span> <span class="ruby-node">&quot;self.#{ var.to_s[1..] }&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">var</span>.<span class="ruby-identifier">to_s</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span>].<span class="ruby-identifier">to_sym</span>, <span class="ruby-keyword">false</span>]]]
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">rbs_declared</span>
    [<span class="ruby-identifier">var</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>)]
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">compact</span>

  <span class="ruby-identifier">cvars</span> = <span class="ruby-identifier">cvars</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span>, <span class="ruby-identifier">entry</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">absolute_paths</span>.<span class="ruby-identifier">all?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span> }
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">rbs_declared</span>
    [<span class="ruby-identifier">var</span>, <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span>.<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>)]
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">compact</span>

  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">absolute_path</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">absolute_path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">all?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span>,<span class="ruby-operator">|</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:rbs</span> }
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">consts</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">modules</span>[<span class="ruby-value">:before</span>][<span class="ruby-keyword">true</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">modules</span>[<span class="ruby-value">:before</span>][<span class="ruby-keyword">false</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">modules</span>[<span class="ruby-value">:after</span>][<span class="ruby-keyword">true</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">modules</span>[<span class="ruby-value">:after</span>][<span class="ruby-keyword">false</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">ivars</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">cvars</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">inner_classes</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">namespace</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-constant">ClassData</span>.<span class="ruby-identifier">new</span>(
    <span class="ruby-value">kind:</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">kind</span>,
    <span class="ruby-value">name:</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">name</span>,
    <span class="ruby-value">superclass:</span> <span class="ruby-identifier">superclass</span>,
    <span class="ruby-value">consts:</span> <span class="ruby-identifier">consts</span>,
    <span class="ruby-value">modules:</span> <span class="ruby-identifier">modules</span>,
    <span class="ruby-value">ivars:</span> <span class="ruby-identifier">ivars</span>,
    <span class="ruby-value">cvars:</span> <span class="ruby-identifier">cvars</span>,
    <span class="ruby-value">methods:</span> <span class="ruby-identifier">methods</span>,
    <span class="ruby-value">visibilities:</span> <span class="ruby-identifier">visibilities</span>,
    <span class="ruby-value">source_locations:</span> <span class="ruby-identifier">source_locations</span>,
    <span class="ruby-value">inner_classes:</span> <span class="ruby-identifier">inner_classes</span>,
  )
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_class_lsp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_class_lsp</span><span
                                class="method-args">(namespace, class_def)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="conv_class_lsp-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/export.rb, line 268</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_class_lsp</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">class_def</span>)
  <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">namespace</span> = <span class="ruby-identifier">namespace</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:__root__</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass</span>
    <span class="ruby-identifier">omit</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Builtin</span>[<span class="ruby-value">:obj</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Builtin</span>[<span class="ruby-value">:obj</span>]
    <span class="ruby-identifier">superclass</span> = <span class="ruby-identifier">omit</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">get_class_name</span>(<span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass</span>)
    <span class="ruby-identifier">type_args</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">klass_obj</span>.<span class="ruby-identifier">superclass_type_args</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">type_args</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">type_args</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">superclass</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot;[#{ type_args.map {|ty| ty.screen_name(@scratch) }.join(&quot;, &quot;) }]&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">namespace</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">name</span>

  <span class="ruby-identifier">consts</span> = {}
  <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">consts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, (<span class="ruby-identifier">ty</span>, <span class="ruby-identifier">loc</span>)<span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">loc</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>)
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">loc</span>[<span class="ruby-value">0</span>]) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>
    <span class="ruby-identifier">consts</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">modules</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">modules</span>.<span class="ruby-identifier">to_h</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">kind</span>, <span class="ruby-identifier">mods</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">mods</span> = <span class="ruby-identifier">mods</span>.<span class="ruby-identifier">to_h</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mods</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">mods</span> = <span class="ruby-identifier">mods</span>.<span class="ruby-identifier">filter_map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mod_def</span>, <span class="ruby-identifier">_type_args</span>, <span class="ruby-identifier">absolute_paths</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">absolute_paths</span>.<span class="ruby-identifier">all?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">path</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span> }
        <span class="ruby-constant">Type</span><span class="ruby-operator">::</span><span class="ruby-constant">Instance</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">mod_def</span>.<span class="ruby-identifier">klass_obj</span>).<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>)
      <span class="ruby-keyword">end</span>
      [<span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mods</span>]
    <span class="ruby-keyword">end</span>
    [<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">mods</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">visibilities</span> = {}
  <span class="ruby-identifier">source_locations</span> = {}
  <span class="ruby-identifier">methods</span> = {}
  <span class="ruby-identifier">ivars</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">ivars</span>.<span class="ruby-identifier">dump</span>
  <span class="ruby-identifier">cvars</span> = <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">cvars</span>.<span class="ruby-identifier">dump</span>

  <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span>(<span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mid</span>), <span class="ruby-identifier">mdefs</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">mdefs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mdef</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">mdef</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">ISeqMethodDef</span>
        <span class="ruby-identifier">ctxs</span> = <span class="ruby-ivar">@iseq_method_to_ctxs</span>[<span class="ruby-identifier">mdef</span>]
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">ctxs</span>

        <span class="ruby-identifier">ctx</span> = <span class="ruby-identifier">ctxs</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">ctx</span><span class="ruby-operator">|</span> <span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">mid</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mid</span> } <span class="ruby-operator">||</span> <span class="ruby-identifier">ctxs</span>.<span class="ruby-identifier">first</span>

        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">absolute_path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>

        <span class="ruby-identifier">method_name</span> = <span class="ruby-identifier">mid</span>
        <span class="ruby-identifier">method_name</span> = <span class="ruby-node">&quot;self.#{ method_name }&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton</span>

        <span class="ruby-identifier">key</span> = [<span class="ruby-value">:iseq</span>, <span class="ruby-identifier">method_name</span>]
        <span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">pub_meth</span>
        <span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> [<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">source_location</span>(<span class="ruby-value">0</span>)]
        <span class="ruby-identifier">sig</span> = <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">show_method_signature</span>(<span class="ruby-identifier">ctx</span>)
        (<span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">sig</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">sig</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">AliasMethodDef</span>
        <span class="ruby-identifier">alias_name</span>, <span class="ruby-identifier">orig_name</span> = <span class="ruby-identifier">mid</span>, <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">orig_mid</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton</span>
          <span class="ruby-identifier">alias_name</span> = <span class="ruby-node">&quot;self.#{ alias_name }&quot;</span>
          <span class="ruby-identifier">orig_name</span> = <span class="ruby-node">&quot;self.#{ orig_name }&quot;</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">key</span> = [<span class="ruby-value">:alias</span>, <span class="ruby-identifier">alias_name</span>]
        <span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">pub_meth</span>
        <span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> [<span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">def_ep</span>&amp;.<span class="ruby-identifier">source_location</span>]
        <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">orig_name</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">ExecutedAttrMethodDef</span>
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">def_ep</span>
        <span class="ruby-identifier">absolute_path</span> = <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">def_ep</span>.<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">absolute_path</span>
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">absolute_path</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">absolute_path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>
        <span class="ruby-identifier">mid</span> = <span class="ruby-identifier">mid</span>.<span class="ruby-identifier">to_s</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>].<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mid</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-string">&quot;=&quot;</span>)
        <span class="ruby-identifier">method_name</span> = <span class="ruby-identifier">mid</span>
        <span class="ruby-identifier">method_name</span> = <span class="ruby-node">&quot;self.#{ mid }&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton</span>
        <span class="ruby-identifier">method_name</span> = [<span class="ruby-identifier">method_name</span>, <span class="ruby-value">:&quot;@#{ mid }&quot;</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">ivar</span>]
        <span class="ruby-identifier">key</span> = [<span class="ruby-value">:attr</span>, <span class="ruby-identifier">method_name</span>]
        <span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">pub_meth</span>
        <span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> [<span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">def_ep</span>.<span class="ruby-identifier">source_location</span>]
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>]
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>][<span class="ruby-value">0</span>] <span class="ruby-operator">!=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">kind</span>
            <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>][<span class="ruby-value">0</span>] = <span class="ruby-value">:accessor</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">ivars</span>[[<span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">ivar</span>]]
          <span class="ruby-identifier">ty</span> = <span class="ruby-identifier">entry</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Type</span>.<span class="ruby-identifier">any</span>
          <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>] = [<span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>), <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">include_untyped?</span>(<span class="ruby-ivar">@scratch</span>)]
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">TypedMethodDef</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">rbs_source</span>
          <span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">sigs</span>, <span class="ruby-identifier">rbs_code_range</span> = <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">rbs_source</span>
          <span class="ruby-identifier">key</span> = [<span class="ruby-value">:rbs</span>, <span class="ruby-identifier">method_name</span>]
          <span class="ruby-identifier">methods</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">sigs</span>
          <span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">pub_meth</span>
          <span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> [<span class="ruby-identifier">mdef</span>.<span class="ruby-identifier">iseq</span>&amp;.<span class="ruby-identifier">source_location</span>(<span class="ruby-value">0</span>), <span class="ruby-identifier">rbs_code_range</span>]
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">ivars</span> = <span class="ruby-identifier">ivars</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span>(<span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">var</span>), <span class="ruby-identifier">entry</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">absolute_paths</span>.<span class="ruby-identifier">all?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span> }
    <span class="ruby-identifier">ty</span> = <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">var</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;@&quot;</span>)
    <span class="ruby-identifier">var</span> = <span class="ruby-node">&quot;self.#{ var }&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>[[<span class="ruby-value">:attr</span>, [<span class="ruby-identifier">singleton</span> <span class="ruby-operator">?</span> <span class="ruby-node">&quot;self.#{ var.to_s[1..] }&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">var</span>.<span class="ruby-identifier">to_s</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span>].<span class="ruby-identifier">to_sym</span>, <span class="ruby-keyword">false</span>]]]
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">rbs_declared</span>
    [<span class="ruby-identifier">var</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>)]
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">compact</span>

  <span class="ruby-identifier">cvars</span> = <span class="ruby-identifier">cvars</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span>, <span class="ruby-identifier">entry</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">absolute_paths</span>.<span class="ruby-identifier">all?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span> }
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">rbs_declared</span>
    [<span class="ruby-identifier">var</span>, <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">type</span>.<span class="ruby-identifier">screen_name</span>(<span class="ruby-ivar">@scratch</span>)]
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">compact</span>

  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">absolute_path</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">check_dir_filter</span>(<span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">absolute_path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">:exclude</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">all?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span>,<span class="ruby-operator">|</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:rbs</span> }
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">consts</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">modules</span>[<span class="ruby-value">:before</span>][<span class="ruby-keyword">true</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">modules</span>[<span class="ruby-value">:before</span>][<span class="ruby-keyword">false</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">modules</span>[<span class="ruby-value">:after</span>][<span class="ruby-keyword">true</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">modules</span>[<span class="ruby-value">:after</span>][<span class="ruby-keyword">false</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">ivars</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">cvars</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@scratch</span>.<span class="ruby-identifier">namespace</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-constant">ClassData</span>.<span class="ruby-identifier">new</span>(
    <span class="ruby-value">kind:</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">kind</span>,
    <span class="ruby-value">name:</span> <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">name</span>,
    <span class="ruby-value">superclass:</span> <span class="ruby-identifier">superclass</span>,
    <span class="ruby-value">consts:</span> <span class="ruby-identifier">consts</span>,
    <span class="ruby-value">modules:</span> <span class="ruby-identifier">modules</span>,
    <span class="ruby-value">ivars:</span> <span class="ruby-identifier">ivars</span>,
    <span class="ruby-value">cvars:</span> <span class="ruby-identifier">cvars</span>,
    <span class="ruby-value">methods:</span> <span class="ruby-identifier">methods</span>,
    <span class="ruby-value">visibilities:</span> <span class="ruby-identifier">visibilities</span>,
    <span class="ruby-value">source_locations:</span> <span class="ruby-identifier">source_locations</span>,
  )
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show</span><span
                                class="method-args">(stat_eps, output)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/export.rb, line 444</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show</span>(<span class="ruby-identifier">stat_eps</span>, <span class="ruby-identifier">output</span>)
  <span class="ruby-comment"># make the class hierarchy</span>
  <span class="ruby-identifier">root</span> = {}
  <span class="ruby-ivar">@class_defs</span>.<span class="ruby-identifier">each_value</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">class_def</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">h</span> = <span class="ruby-identifier">root</span>
    <span class="ruby-identifier">class_def</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">h</span> = <span class="ruby-identifier">h</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> {}
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">h</span>[<span class="ruby-value">:class_def</span>] = <span class="ruby-identifier">class_def</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">hierarchy</span> = <span class="ruby-identifier">build_class_hierarchy</span>([], <span class="ruby-identifier">root</span>)

  <span class="ruby-identifier">output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;# Classes&quot;</span> <span class="ruby-comment"># and Modules</span>

  <span class="ruby-identifier">prev_nil</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-identifier">show_class_hierarchy</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">hierarchy</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">line</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">prev_nil</span>
      <span class="ruby-identifier">prev_nil</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">line</span>
      <span class="ruby-identifier">prev_nil</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;TP_STAT&quot;</span>]
    <span class="ruby-identifier">output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;&quot;</span>
    <span class="ruby-identifier">output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;# TypeProf statistics:&quot;</span>
    <span class="ruby-identifier">output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;#   %d execution points&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">stat_eps</span>.<span class="ruby-identifier">size</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;TP_COVERAGE&quot;</span>]
    <span class="ruby-identifier">coverage</span> = {}
    <span class="ruby-identifier">stat_eps</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ep</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">path</span> = <span class="ruby-identifier">ep</span>.<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">path</span>
      <span class="ruby-identifier">lineno</span> = <span class="ruby-identifier">ep</span>.<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">insns</span>[<span class="ruby-identifier">ep</span>.<span class="ruby-identifier">pc</span>].<span class="ruby-identifier">lineno</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
      (<span class="ruby-identifier">coverage</span>[<span class="ruby-identifier">path</span>] <span class="ruby-operator">||=</span> [])[<span class="ruby-identifier">lineno</span>] <span class="ruby-operator">||=</span> <span class="ruby-value">0</span>
      (<span class="ruby-identifier">coverage</span>[<span class="ruby-identifier">path</span>] <span class="ruby-operator">||=</span> [])[<span class="ruby-identifier">lineno</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-constant">File</span>.<span class="ruby-identifier">binwrite</span>(<span class="ruby-string">&quot;typeprof-analysis-coverage.dump&quot;</span>, <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">coverage</span>))
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_class_data" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_class_data</span><span
                                class="method-args">(depth, class_data)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_class_data-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/export.rb, line 512</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_class_data</span>(<span class="ruby-identifier">depth</span>, <span class="ruby-identifier">class_data</span>)
  <span class="ruby-identifier">indent</span> = <span class="ruby-string">&quot;  &quot;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">depth</span>
  <span class="ruby-identifier">name</span> = <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">last</span>
  <span class="ruby-identifier">superclass</span> = <span class="ruby-string">&quot; &lt; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">superclass</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">superclass</span>
  <span class="ruby-identifier">first_line</span> = <span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;#{ class_data.kind } #{ name }#{ superclass }&quot;</span>
  <span class="ruby-identifier">lines</span> = []
  <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">consts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">ty</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;  #{ name }: #{ ty }&quot;</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">modules</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">kind</span>, <span class="ruby-identifier">mods</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">mods</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">singleton</span>, <span class="ruby-identifier">mods</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">case</span>
      <span class="ruby-keyword">when</span> <span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value">:before</span> <span class="ruby-operator">&amp;&amp;</span>  <span class="ruby-identifier">singleton</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">directive</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">when</span> <span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value">:before</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">singleton</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">directive</span> = <span class="ruby-string">&quot;prepend&quot;</span>
      <span class="ruby-keyword">when</span> <span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value">:after</span>  <span class="ruby-operator">&amp;&amp;</span>  <span class="ruby-identifier">singleton</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">directive</span> = <span class="ruby-string">&quot;extend&quot;</span>
      <span class="ruby-keyword">when</span> <span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value">:after</span>  <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">singleton</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">directive</span> = <span class="ruby-string">&quot;include&quot;</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">mods</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;  #{ directive } #{ mod }&quot;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">directive</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">ivars</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span>, <span class="ruby-identifier">ty</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;  #{ var }: #{ ty }&quot;</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">var</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;_&quot;</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">cvars</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span>, <span class="ruby-identifier">ty</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;  #{ var }: #{ ty }&quot;</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">prev_vis</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">vis</span> = <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">visibilities</span>[<span class="ruby-identifier">key</span>]
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">prev_vis</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">vis</span>
      <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;  #{ vis ? &quot;public&quot; : &quot;private&quot; }&quot;</span>)
      <span class="ruby-identifier">prev_vis</span> = <span class="ruby-identifier">vis</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">source_location</span> = <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>]
    <span class="ruby-keyword">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">options</span>[<span class="ruby-value">:show_source_locations</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">source_location</span>
      <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;  # #{ source_location }&quot;</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">type</span>, (<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">hidden</span>) = <span class="ruby-identifier">key</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:rbs_attr</span>
      <span class="ruby-identifier">kind</span>, <span class="ruby-identifier">ty</span>, <span class="ruby-identifier">untyped</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>
      <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;# attr_#{ kind } #{ method_name }#{ hidden ? &quot;()&quot; : &quot;&quot; }: #{ ty }&quot;</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-value">:attr</span>
      <span class="ruby-identifier">kind</span>, <span class="ruby-identifier">ty</span>, <span class="ruby-identifier">untyped</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>
      <span class="ruby-identifier">exclude</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">options</span>[<span class="ruby-value">:exclude_untyped</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">untyped</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot;#&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-comment"># XXX</span>
      <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;#{ exclude } attr_#{ kind } #{ method_name }#{ hidden ? &quot;()&quot; : &quot;&quot; }: #{ ty }&quot;</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-value">:rbs</span>
      <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;#&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">5</span>)) }
      <span class="ruby-identifier">sigs</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;#&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">5</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;| &quot;</span>)
      <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;# def #{ method_name }: #{ sigs }&quot;</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-value">:iseq</span>
      <span class="ruby-identifier">sigs</span> = []
      <span class="ruby-identifier">untyped</span> = <span class="ruby-keyword">false</span>
      <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sig</span>, <span class="ruby-identifier">untyped0</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">sigs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">sig</span>
        <span class="ruby-identifier">untyped</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">untyped0</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">sigs</span> = <span class="ruby-identifier">sigs</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">6</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;| &quot;</span>)
      <span class="ruby-identifier">exclude</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">options</span>[<span class="ruby-value">:exclude_untyped</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">untyped</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot;#&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-comment"># XXX</span>
      <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;#{ exclude } def #{ method_name }: #{ sigs }&quot;</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-value">:alias</span>
      <span class="ruby-identifier">orig_name</span> = <span class="ruby-identifier">arg</span>
      <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;  alias #{ method_name } #{ orig_name }&quot;</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">show_class_hierarchy</span>(<span class="ruby-identifier">depth</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">inner_classes</span>)
  <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">shift</span> <span class="ruby-keyword">until</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">first</span>
  <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">pop</span> <span class="ruby-keyword">until</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">last</span>
  <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">first_line</span>
  <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">indent</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;end&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_class_hierarchy" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_class_hierarchy</span><span
                                class="method-args">(depth, hierarchy)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_class_hierarchy-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/export.rb, line 496</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_class_hierarchy</span>(<span class="ruby-identifier">depth</span>, <span class="ruby-identifier">hierarchy</span>)
  <span class="ruby-identifier">lines</span> = []
  <span class="ruby-identifier">hierarchy</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">class_data</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">show_class_data</span>(<span class="ruby-identifier">depth</span>, <span class="ruby-identifier">class_data</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">lines</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_const" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_const</span><span
                                class="method-args">(namespace, path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_const-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/export.rb, line 505</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_const</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">path</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">namespace</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">path</span>
  <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
  <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">while</span> <span class="ruby-identifier">namespace</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">namespace</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">path</span>[<span class="ruby-identifier">i</span>]
  <span class="ruby-identifier">path</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">..</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;::&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_lsp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_lsp</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_lsp-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/export.rb, line 408</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_lsp</span>
  <span class="ruby-identifier">res</span> = []
  <span class="ruby-ivar">@class_defs</span>.<span class="ruby-identifier">each_value</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">class_def</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">class_data</span> = <span class="ruby-identifier">conv_class_lsp</span>([], <span class="ruby-identifier">class_def</span>)
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">class_data</span>
    <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">source_location</span>, <span class="ruby-identifier">rbs_code_range</span> = <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">source_locations</span>[<span class="ruby-identifier">key</span>]
      <span class="ruby-identifier">type</span>, (<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">hidden</span>) = <span class="ruby-identifier">key</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:attr</span>, <span class="ruby-value">:rbs_attr</span>
        <span class="ruby-identifier">kind</span>, <span class="ruby-identifier">ty</span>, <span class="ruby-identifier">untyped</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>
        <span class="ruby-identifier">line</span> = <span class="ruby-node">&quot;attr_#{ kind } #{ method_name }#{ hidden ? &quot;()&quot; : &quot;&quot; }: #{ ty }&quot;</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:rbs</span>
        <span class="ruby-identifier">sigs</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot; | &quot;</span>)
        <span class="ruby-identifier">line</span> = <span class="ruby-node">&quot;# def #{ method_name }: #{ sigs }&quot;</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:iseq</span>
        <span class="ruby-identifier">sigs</span> = []
        <span class="ruby-identifier">untyped</span> = <span class="ruby-keyword">false</span>
        <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sig</span>, <span class="ruby-identifier">untyped0</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">sigs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">sig</span>
          <span class="ruby-identifier">untyped</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">untyped0</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">sigs</span> = <span class="ruby-identifier">sigs</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot; | &quot;</span>)
        <span class="ruby-identifier">line</span> = <span class="ruby-node">&quot;def #{ method_name }: #{ sigs }&quot;</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:alias</span>
        <span class="ruby-identifier">orig_name</span> = <span class="ruby-identifier">arg</span>
        <span class="ruby-identifier">line</span> = <span class="ruby-node">&quot;alias #{ method_name } #{ orig_name }&quot;</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">source_location</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/:(\d+)$/</span>
        <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-node">$`</span>, <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">line</span>, <span class="ruby-identifier">rbs_code_range</span>, <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">class_data</span>.<span class="ruby-identifier">name</span>]
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">res</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

